//+------------------------------------------------------------------+
//|                                                      BarList.mqh |
//|                               Copyright 2016, STW Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, STW Software Corp."
#property link      "https://www.mql5.com"
#property strict
#include <StrategyBar.mqh>;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class StrategyBarList
  {
protected:
   StrategyBar      *List[];
   int               Size;
   int               WorkId;
   int Add(StrategyBar &Value)
     {
      Size=ArraySize(List);
      Size=Size+1;
      ArrayResize(List,Size);
      int IndexId=Size-1;
      List[IndexId]=GetPointer(Value);
      return IndexId;
     }
public:
                     StrategyBarList(void){WorkId=0;};
                    ~StrategyBarList(void){};
     
   StrategyBar*Next()
     {
      WorkId=WorkId+1;
      if(WorkId>Size-1)
        {
         WorkId=0;
        }
      return List[WorkId];
     }
   StrategyBar*Reset()
     {
      WorkId=0;
      return List[WorkId];
     }
     
   StrategyBar*Now()
     {
      return List[WorkId];
     }
     
   StrategyBar*GetByIndex(int IndexId)
     {
      return List[IndexId];
     }
     
   int GetSize()
     {
      return Size;
     }
     
   int GetWorkId()
     {
      return WorkId;
     }
  };
//+------------------------------------------------------------------+
